#include <stdio.h>
int main()
{
	int age = 78;
	if (age < 18)
		printf("少年\n");
	//错误示范：else if(18<=age<26)
	else if (age >= 18 && age < 26)
		printf("青年\n");
	else if (age >= 26 && age <= 40)
		printf("中年\n");
	else if (age >= 40 && age <= 60)
		printf("老年");
	else
		printf("老年");

	//else /if 默认控制一条语句 要打{}控制多条
	return 0;
}
int main()
{
	int a = 0;
	int b = 2;
	if (a == 1) 
		if (b == 2)
			printf("hehe");
	    else//不打{}则与离它最近的if匹配
			printf("haha");
		
	return 0;
}//结果不打印
int main()
{
	int num = 3;
	if (5 == num)//当两个整形比较时 把常量放在左边
		printf("hehe");
}
//编程题 判断一个数是否为奇数
int main()
{
	int m = 0;
	scanf_s("%d", &m);
	if (1==m%2)
		printf("YES");
	else
		printf("NO");
	return 0;
}
//输出1—100的奇数
int main()
{
	int a= 0;
	while (a < 100 )
	{
		if(a%2==1)
		printf("%d ", a);
		a++;
	}
	return 0;
}
//标准答案
int main()
{
	int i = 0;
	for (i = 1;i <= 100;i++)
	{
		if (i % 2 == 1)
		  printf("%d ",i);
	}
	return 0;
}
int main()
{
	int i = 0;
	for (i = 1;i <= 100;i+=2)
	{
			printf("%d ", i);
	}
	return 0;
}